package com.gisway.pick.tool;

import java.text.SimpleDateFormat;
import java.util.TimeZone;

public class ConvertDate {

    public static void testDate(String time){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("时区："+sdf.getTimeZone());
        sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
        try {
            System.out.println("入库时间："+sdf.parse(time).toInstant());
        }catch(Exception e){
            System.out.println("时间格式转换失败："+time);
        }
    }

}
